(xlfd_charset_of_font): Fix last change.
authorAndrew Innes <andrewi@gnu.org>
Thu, 7 Dec 2000 10:41:05 +0000 (10:41 +0000)
committerAndrew Innes <andrewi@gnu.org>
Thu, 7 Dec 2000 10:41:05 +0000 (10:41 +0000)
src/w32fns.c

index 50c86d5e944b9d797800c4232ae8a123be4fecb3..b65be25262f56f93f0001e42b69455a2d5606a1d 100644 (file)
@@ -5462,9 +5462,11 @@ char * xlfd_charset_of_font (char * fontname)
   if (!encoding || encoding == fontname)
     return NULL;
 
-  charset = strrchr(encoding - 1, '-');
+  for (charset = encoding - 1; charset >= fontname; charset--)
+    if (*charset == '-')
+      break;
 
-  if (!charset || strcmp(charset, "-*-*") == 0)
+  if (charset == fontname || strcmp(charset, "-*-*") == 0)
     return NULL;
 
   return charset + 1;